package com.ymk.cmd;

import com.ymk.base.cmd.ACmd;
import com.ymk.base.cmd.CmdSign;
import com.ymk.bo.goods.GoodsSkuPropBO;
import com.ymk.core.code.cmd.GoodsCmdCode;
import com.ymk.service.IGoodsSkuPropService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;

@Service
public class GoodsSkuPropDelCmd extends ACmd {

    @Override
    public CmdSign executeMop(HttpServletRequest request, CmdSign sign) throws Exception {
        CmdSign respSign = new CmdSign(sign);
        GoodsSkuPropBO reqData = super.getData(sign, GoodsSkuPropBO.class);

        GoodsSkuPropBO delGoodsSkuPropBO = new GoodsSkuPropBO();
        delGoodsSkuPropBO.setId(reqData.getId());
        this.GoodsSkuPropService.del(delGoodsSkuPropBO);

        return respSign;
    }

    @Override
    public String getCmdCode() {
        return GoodsCmdCode.GOODS_SKU_PROP_DEL;
    }

    @Autowired
    private IGoodsSkuPropService GoodsSkuPropService;
}